package org.db2.project.airline.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import java.io.Serializable;


/**
 * The persistent class for the FLIGHTCREWASSIGMENT database table.
 */
@Entity
public class FlightCrewAssigment implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @SequenceGenerator(name = "FLIGHTCREWASSIGMENT_ID_GENERATOR", sequenceName = "FLIGHTCREWASSIGMENT_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "FLIGHTCREWASSIGMENT_ID_GENERATOR")
    private long id;

    //bi-directional many-to-one association to CrewRole
    @ManyToOne
    @JoinColumn(name = "CREWROLEID")
    private CrewRole crewRole;

    //bi-directional many-to-one association to Employee
    @ManyToOne
    @JoinColumn(name = "EMPLOYEEID")
    private Employee employee;

    public FlightCrewAssigment() {
    }

    public long getId() {
        return this.id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public CrewRole getCrewRole() {
        return this.crewRole;
    }

    public void setCrewRole(CrewRole crewRole) {
        this.crewRole = crewRole;
    }

    public Employee getEmployee() {
        return this.employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

}